const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

/**
 * Export model definition object.
 */
module.exports = {
  number: Number,
  creatorId: ObjectId,
  projectId: ObjectId,
  versionId: ObjectId,
  projectName: String,
  versionName: String,
  taskId: mongoose.Mixed,
  type: Number,
  testType: Number,
  status: { type: Number, default: 0 },
  compilingFileIds: [ObjectId],
  fileIds: [ObjectId],
  functionIds: [ObjectId],
  testIds: [ObjectId],
  finishAt: Date,
  resumeAt: Date,
  spent: { type: Number, default: 0 },
  subTaskStatus: Number,
  finishSortBy: { type: Number, default: 0 },
  subTasks: Array,
  progress: { type: Number, default: 0 },
  coverageStatistics: Boolean,
  partiallyExecutedIds: Object,
  currentSubTask: Number, // 当前正在执行的sub task kind
  lastRunFunctionId: ObjectId, // 已经执行到的function id，作为分批执行到标识
  firstRunFunctionId: ObjectId, // 当前分批中执行的第一个function id
  ruleIds: Array, // 运行时检查规则id
  codeInstrumentationId: ObjectId, // 代码插桩id
  silence: Boolean, // 是否静默，如果是，不会提示前端
};
